const ts:string = "typeScript";
console.log(ts)

import _ from "lodash"
import "./style/index.css"
import Print from "./assets/print.png"
import {print as printFn} from "./utils/print"
import {randomNumber} from "./utils/math"
function component(){
  var element =document.createElement('div')
  var btn = document.createElement('button')
  
  element.innerHTML = _.join(["hellow","webpack"],"-")
  element.classList.add("hello")

  btn.innerHTML = "click counld print!"
  btn.addEventListener('click',printFn)
  btn.addEventListener('click',randomNumber)
  // 添加图像
  var print = new Image()
  print.src = Print
  // element.appendChild(print)
  element.appendChild(btn)
  return element;
}

//  ------   npm 发布的包测试
// import wordObj from "echoword_personpublish"
// wordObj.echoword("npm 测试打印包!")
let element = component()
document.body.appendChild(element)
// console.log(module.)
if(module.hot){
  module.hot.accept("./utils/print",function(){
    console.log("Accepting the updated print moudle!")
    document.removeChild(element)
    element = component()
    document.body.appendChild(element)
  })
}
// const p1 = new Promise((resolve,reject)=>{
//   console.log("this is Promise");
//   resolve("成功了!")
// }).then((res)=>{
//   console.log(res)
// },err=>{
//   console.log(err)
// })


//  --- 殷俊npm测试
/* 
  import yinjun from "yinjun-fun";z
  console.log(yinjun) 
*/
// import ("./snoabbdom/index.js")
// require("./snoabbdom/index.js")
